bpo-34969: Add --fast, --best on the gzip CLI#9833
Conversation
|
I'm not for implementing |
|
good catch, I have removed |
There was a problem hiding this comment.
Minor nit, I am not sure bester is a valid word. "Best compression" maybe?
JulienPalard
left a comment
There was a problem hiding this comment.
If you change the default compression from the CLI you may want to tell it in the NEWS file.
There was a problem hiding this comment.
Missing dot at end of sentence.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
There was a problem hiding this comment.
@vadmium sure, if we use the level 6, it's not the --best flag.
thanks
There was a problem hiding this comment.
"unversionned" python must not be used: please write python3 (and change the existing documentation for "file").
I'm not sure that it's useful to add an example of a command for each command line option.
There was a problem hiding this comment.
Actually, most examples in the current Doc do use an unversioned python for -m examples. Only a few currently use python3 -m. We should probably decide on which is better and fix them all. But that should be a separate issue and PR.
There was a problem hiding this comment.
I think it's better to use pythoninstead of python3 since that will add the extra work of replacing all python3 with python4 when we have a release in future :) Many examples will be compatible with both versions and also might cause issues in backporting doc fixes between two major versions . The URL and drop-down at the top already indicates python3.X version. I might be missing a use case here.
There was a problem hiding this comment.
I remove the example with the command line and in this way, just avoid the "un.versioned" python.
There was a problem hiding this comment.
Please make these constants private. If you really want to make them public, you should document them.
There was a problem hiding this comment.
maybe with a new PR/bpo
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
There was a problem hiding this comment.
this test is redundant, assert_python_ok() ensures thta it's 0.
There was a problem hiding this comment.
11 lines just to pass a flag? IMHO it's too much, it can be done with less code: see below.
There was a problem hiding this comment.
"gzip: Add --fast and --best options on the gzip CLI ..."
There was a problem hiding this comment.
I suggest to remove "it's a good tradeoff between the best and fast compression methods". I wouldn't promise that it's a good tradeoff. Compression is full of bad surprises.
Just one example from gzip manual page:
"In some rare cases, the --best option gives worse compression than the default compression level (-6). On some highly redundant files, compress compresses better than gzip."
There was a problem hiding this comment.
Can't we expect a specific exit code? Same question for following test.
--fast and --best are the new parameters. They indicate to Gzip if we want to have a fast compression method or a slow method (best compression).
vstinner
left a comment
There was a problem hiding this comment.
LGTM.
@JulienPalard: Can you please double please? You can merge it if it looks good to you.
|
@JulienPalard are you interested by a merge of this PR? |
|
LGTM too :) thanks @matrixise for this PR! |
https://bugs.python.org/issue34969